Page({

  /**
   * 页面的初始数据
   */
  data: {
    // tab切换 
    currentTab: 0,
    videolist:[
        { index:0,
          videoUrl:'http://r4gtus798.hn-bkt.clouddn.com/421141368-1-208.mp4',
          videoName:'哥谭噩梦',
          videoOwner:'作者1',
          pictureSrc:'http://r4gtus798.hn-bkt.clouddn.com/%E5%93%A5%E8%B0%AD%E5%99%A9%E6%A2%A6.png',
          videoInfoma:'这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容'
        },
        { index:1,
          videoUrl:'http://r4gtus798.hn-bkt.clouddn.com/446405333-1-208.mp4',
          videoName:'水母迷因',
          videoOwner:'作者2',
          pictureSrc:'http://r4gtus798.hn-bkt.clouddn.com/%E6%B0%B4%E6%AF%8D%E8%BF%B7%E5%9B%A0.png',
          videoInfoma:'这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容'
        }
      ]
},
    swichNav: function (e) {
    console.log(e);
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
        return false;
    } else {
        that.setData({
            currentTab: e.target.dataset.current,
         })
    }
},
    swiperChange: function (e) {
    console.log(e);
    this.setData({
        currentTab: e.detail.current,
    })

},

    storeVideoInfo: function(ev) {
    var that = this;
    var Url = ev.currentTarget.dataset.url;
    var VideoName = ev.currentTarget.dataset.videoname;
    var VideoOwner = ev.currentTarget.dataset.videoowner;
    var VideoInfoma = ev.currentTarget.dataset.videoinfoma;
    console.log("success",ev,that)
    wx.setStorageSync("video_url", Url)
    wx.setStorageSync("video_name", VideoName)
    wx.setStorageSync("video_owner", VideoOwner)
    wx.setStorageSync("video_infoma", VideoInfoma)
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const current_tap =wx.getStorageSync("currentTapX");
    this.setData({
      currentTab: current_tap
    })
  },
  

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})